﻿using System.Collections.Generic;
using System.ComponentModel;

namespace RiskMan.DataClass.BaseTransaqCalss
{
    class FortsMoney : INotifyPropertyChanged
    {
        #region Private

        private string _client;
        private List<int> _markets;
        private string _shortname;
        private double _current;
        private double _blocked;
        private double _free;
        private double _varmargin;


        #endregion

        #region Public

        /// <summary>
        /// Идентификатор клиента
        /// </summary>
        public string Client
        {
            get { return _client; }
            set
            {
                if (_client != value)
                {
                    _client = value;
                    RaisePropertyChanged("Client");
                }
            }
        }

        /// <summary>
        /// Внутренний код рынка
        /// </summary>
        public List<int> Markets
        {
            get { return _markets; }
            set
            {
                if (_markets != value)
                {
                    _markets = value;
                    RaisePropertyChanged("Markets");
                }
            }
        }

        /// <summary>
        /// Наименование вида средств
        /// </summary>
        public string Shortname
        {
            get { return _shortname; }
            set
            {
                if (_shortname != value)
                {
                    _shortname = value;
                    RaisePropertyChanged("Shortname");
                }
            }
        }

        /// <summary>
        /// Текущие
        /// </summary>
        public double Current
        {
            get { return _current; }
            set
            {
                if (_current != value)
                {
                    _current = value;
                    RaisePropertyChanged("Current");
                }
            }
        }

        /// <summary>
        /// Заблокировано
        /// </summary>
        public double Blocked
        {
            get { return _blocked; }
            set
            {
                if (_blocked != value)
                {
                    _blocked = value;
                    RaisePropertyChanged("Blocked");
                }
            }
        }

        /// <summary>
        /// Свободные
        /// </summary>
        public double Free
        {
            get { return _free; }
            set
            {
                if (_free != value)
                {
                    _free = value;
                    RaisePropertyChanged("Free");
                }
            }
        }

        /// <summary>
        /// Опер. маржа
        /// </summary>
        public double Varmargin
        {
            get { return _varmargin; }
            set
            {
                if (_varmargin != value)
                {
                    _varmargin = value;
                    RaisePropertyChanged("Varmargin");
                }
            }
        }

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
